package come.bite.spring.demo;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/calc")
@RestController
public class Controller {
    @RequestMapping("/sum")
    public String sum(Integer num1, Integer num2) {
        if (num1 ==null ||num2 ==null){
            return "数据不合法重新输入";
        }
        Integer sum = num1+ num2;
        return "<h1> 计算结果为:"+sum+"<h1/>";
    }

}
